-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix creating a lot of ephemeral ports when stopping GlassFish. Fix restart on fast machines #25300
Fix creating a lot of ephemeral ports when stopping GlassFish. Fix restart on fast machines #25300
Conversation
- The start succeeded too early and on fast machines collided with shutdown. - Shutdown Hook is really the last thing in the JVM capable of doing it. - All shutdown hooks have names now Signed-off-by: David Matějček <[email protected]>
…cases - when current (old) JVM had enabled debugging, the new one sometimes failed to start. It is not possible to wait from the inside. - Stop the kernell after adding the last shutdown hook; shutdown hooks run in parallel, but we have to ensure that ours will be executed after all other non-daemon hooks finish. - export AS_RESTART_LOGFILES=true to get "old" and "new" files in the server's log directory. It is trivial workaround, because the standard logging system might get into a conflict with the new GF instance too. - The "super debug" is not helpful as it affects timing Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
- its only usage was for the domain restart which was reimplemented Signed-off-by: David Matějček <[email protected]>
- backup of the server.log cannot be done if the server is dead - Using System.Logger instead of JUL Signed-off-by: David Matějček <[email protected]>
- Original code caused local port exhaustion - Original code used busy spinning instead of signals Signed-off-by: David Matějček <[email protected]>
24b4717
to
3c040b2
Compare
Heuréka! And now I see why we had that weird code checking of |
- Reverted usage of ProcessHandle.onExit.get as it doesn't work in containers which don't have strict reaper. The zombie project is considered as alive and get then hangs forever. - Added waitpid, however it is not installed everywhere - if it is missing, we sleep for 1 second instead. That should be enough so the operating system could do the cleanup. Signed-off-by: David Matějček <[email protected]>
3c040b2
to
190fd0b
Compare
nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/StartServerHook.java
Show resolved
Hide resolved
nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/admin/StartServerHook.java
Show resolved
Hide resolved
I renamed this PR so that it reflects all things that were fixed. The title will appear in the release notes so it's good if it clearly describes all that this PR adds/fixes. |
Fixes #25295 and #25292
Replaces #25293
There were several issues, see individual commits. The main problem was that the startup can be faster than shutdown and then they could collide on ports and files. The most problematic was the debug port which is enabled since the JVM startup until the very end.
On my new machine it was reproducible in some 80% of executions.
Solution for #25292:
For #25295 was needed also
export AS_RESTART_LOGFILES=true
;Note
handle#isAlive
returns true andonExit.get
is still blocked.